﻿namespace HRM.CORE.Workdesk.Chart
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraCharts;
    using DevExpress.XtraCharts.Printing;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using APP.HELPER;
    using Common.Report;
    using HRM.CORE;
    using HRM.CORE.REPORT;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms; using Common;
    using Common;
    using DevExpress.XtraGrid.Views.Base;

    public class xucChartBase : Common.xucBase
    {
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarSubItem barSubItem1;
        private BarButtonItem bbiBar;
        private BarButtonItem bbiBar3D;
        private BarButtonItem bbiChart;
        private BarButtonItem bbiExport;
        private BarButtonItem bbiGrid;
        private BarButtonItem bbiPie;
        private BarButtonItem bbiPie3D;
        private BarButtonItem bbiPrint;
        private BarButtonItem bbiRefresh;
        public ChartControl chart;
        private GridColumn colName;
        private GridColumn colValue;
        private IContainer components;
        private GridView gbList;
        private GridControl gcList;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridView gridView1;
        public LinkLabel lbBar;
        public LinkLabel lbExport;
        public LinkLabel lbPie;
        public LinkLabel lbPrint;
        public DataTable m_DataChart;
        public string m_NameChart;
        public int m_Type;
        public PanelControl panelControl8;
        private PopupMenu ppMenu;
        private PopupMenu ppMenu1;
        private RepositoryItemGridLookUpEdit repAllowanceCode;
        private RepositoryItemGridLookUpEdit repAllowanceName;
        private RepositoryItemCalcEdit repMoney;
        private GridView repositoryItemGridLookUpEdit1View;

        public xucChartBase()
        {
            this.components = null;
            this.m_Type = 0;
            this.m_DataChart = new DataTable();
            this.m_NameChart = "";
            this.InitializeComponent();
            this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu1);
            this.barManager1.SetPopupContextMenu(this.chart, this.ppMenu);
        }

        public xucChartBase(int Type, DataTable DataChart)
        {
            this.components = null;
            this.m_Type = 0;
            this.m_DataChart = new DataTable();
            this.m_NameChart = "";
            this.InitializeComponent();
            this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu1);
            this.barManager1.SetPopupContextMenu(this.chart, this.ppMenu);
            this.LoadChart(Type, DataChart);
        }

        private void bbiChart_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.chart.BringToFront();
            this.lbPrint.Visible = true;
            this.lbExport.Visible = false;
            this.lbBar.Visible = true;
            this.lbPie.Visible = true;
            this.bbiChart.Down = true;
            this.bbiGrid.Down = false;
        }

        private void bbiExport_ItemClick(object sender, ItemClickEventArgs e)
        {
            base._exportView = this.gbList;
            SYS_LOG.Insert("Biểu đồ", "Xuất");
            base.Export();
        }

        private void bbiGrid_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.gcList.BringToFront();
            this.lbPrint.Visible = true;
            this.lbExport.Visible = true;
            this.lbBar.Visible = false;
            this.lbPie.Visible = false;
            this.bbiChart.Down = false;
            this.bbiGrid.Down = true;
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.PrintChart();
        }

        private void bbiRefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.ReloadData();
        }

        private void chart_Enter(object sender, EventArgs e)
        {
            if (this.m_Type == 1)
            {
                (this.chart.Series[0].View as PieSeriesView).ExplodeMode = PieExplodeMode.MaxValue;
            }
        }

        private void chart_Leave(object sender, EventArgs e)
        {
            if (this.m_Type == 1)
            {
                (this.chart.Series[0].View as PieSeriesView).ExplodeMode = PieExplodeMode.None;
            }
        }

        private void ChartPrint_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.PrintChart();
        }

        private void ChartType_ItemClick(object sender, ItemClickEventArgs e)
        {
            string name = e.Item.Name;
            if (name != null)
            {
                if (!(name == "bbiBar"))
                {
                    if (name == "bbiPie")
                    {
                        this.LoadChart(1, this.m_DataChart);
                    }
                    else if (name == "bbiBar3D")
                    {
                        this.LoadChart(2, this.m_DataChart);
                    }
                    else if (name == "bbiPie3D")
                    {
                        this.LoadChart(3, this.m_DataChart);
                    }
                }
                else
                {
                    this.LoadChart(0, this.m_DataChart);
                }
            }
        }

        private void ChartType_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string name = (sender as LinkLabel).Name;
            if (name != null)
            {
                if (!(name == "lbBar"))
                {
                    if (name == "lbPie")
                    {
                        this.LoadChart(1, this.m_DataChart);
                    }
                }
                else
                {
                    this.LoadChart(0, this.m_DataChart);
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            SideBySideBarSeriesLabel label = new SideBySideBarSeriesLabel();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucChartBase));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            SerializableAppearanceObject obj3 = new SerializableAppearanceObject();
            this.panelControl8 = new PanelControl();
            this.lbExport = new LinkLabel();
            this.lbBar = new LinkLabel();
            this.lbPie = new LinkLabel();
            this.lbPrint = new LinkLabel();
            this.chart = new ChartControl();
            this.ppMenu = new PopupMenu(this.components);
            this.bbiChart = new BarButtonItem();
            this.bbiGrid = new BarButtonItem();
            this.barSubItem1 = new BarSubItem();
            this.bbiBar = new BarButtonItem();
            this.bbiPie = new BarButtonItem();
            this.bbiBar3D = new BarButtonItem();
            this.bbiPie3D = new BarButtonItem();
            this.bbiPrint = new BarButtonItem();
            this.bbiRefresh = new BarButtonItem();
            this.barManager1 = new BarManager(this.components);
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.bbiExport = new BarButtonItem();
            this.gcList = new GridControl();
            this.gbList = new GridView();
            this.colName = new GridColumn();
            this.colValue = new GridColumn();
            this.repAllowanceCode = new RepositoryItemGridLookUpEdit();
            this.repositoryItemGridLookUpEdit1View = new GridView();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.repAllowanceName = new RepositoryItemGridLookUpEdit();
            this.gridView1 = new GridView();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.repMoney = new RepositoryItemCalcEdit();
            this.ppMenu1 = new PopupMenu(this.components);
            this.panelControl8.BeginInit();
            this.panelControl8.SuspendLayout();
            this.chart.BeginInit();
            ((ISupportInitialize) label).BeginInit();
            this.ppMenu.BeginInit();
            this.barManager1.BeginInit();
            this.gcList.BeginInit();
            this.gbList.BeginInit();
            this.repAllowanceCode.BeginInit();
            this.repositoryItemGridLookUpEdit1View.BeginInit();
            this.repAllowanceName.BeginInit();
            this.gridView1.BeginInit();
            this.repMoney.BeginInit();
            this.ppMenu1.BeginInit();
            base.SuspendLayout();
            this.panelControl8.BorderStyle = BorderStyles.NoBorder;
            this.panelControl8.Controls.Add(this.lbExport);
            this.panelControl8.Controls.Add(this.lbBar);
            this.panelControl8.Controls.Add(this.lbPie);
            this.panelControl8.Controls.Add(this.lbPrint);
            this.panelControl8.Dock = DockStyle.Top;
            this.panelControl8.Location = new Point(0, 0);
            this.panelControl8.Name = "panelControl8";
            this.panelControl8.Size = new Size(0x21d, 0x18);
            this.panelControl8.TabIndex = 7;
            this.lbExport.AutoSize = true;
            this.lbExport.Location = new Point(0x4c, 5);
            this.lbExport.Name = "lbExport";
            this.lbExport.Size = new Size(0x40, 13);
            this.lbExport.TabIndex = 5;
            this.lbExport.TabStop = true;
            this.lbExport.Text = "Xuất dữ liệu";
            this.lbExport.Visible = false;
            this.lbExport.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lbExport_LinkClicked);
            this.lbBar.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lbBar.AutoSize = true;
            this.lbBar.LinkArea = new LinkArea(2, 8);
            this.lbBar.Location = new Point(0x19d, 5);
            this.lbBar.Name = "lbBar";
            this.lbBar.Size = new Size(0x37, 0x12);
            this.lbBar.TabIndex = 4;
            this.lbBar.TabStop = true;
            this.lbBar.Text = "► H\x00ecnh cột";
            this.lbBar.UseCompatibleTextRendering = true;
            this.lbBar.LinkClicked += new LinkLabelLinkClickedEventHandler(this.ChartType_LinkClicked);
            this.lbPie.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lbPie.AutoSize = true;
            this.lbPie.LinkArea = new LinkArea(2, 9);
            this.lbPie.Location = new Point(0x1db, 5);
            this.lbPie.Name = "lbPie";
            this.lbPie.Size = new Size(60, 0x12);
            this.lbPie.TabIndex = 3;
            this.lbPie.TabStop = true;
            this.lbPie.Text = "► H\x00ecnh tr\x00f2n";
            this.lbPie.UseCompatibleTextRendering = true;
            this.lbPie.LinkClicked += new LinkLabelLinkClickedEventHandler(this.ChartType_LinkClicked);
            this.lbPrint.AutoSize = true;
            this.lbPrint.Location = new Point(5, 5);
            this.lbPrint.Name = "lbPrint";
            this.lbPrint.Size = new Size(0x37, 13);
            this.lbPrint.TabIndex = 2;
            this.lbPrint.TabStop = true;
            this.lbPrint.Text = "In biểu đồ";
            this.lbPrint.LinkClicked += new LinkLabelLinkClickedEventHandler(this.ChartPrint_LinkClicked);
            this.chart.BorderOptions.Color = Color.Transparent;
            this.chart.BorderOptions.Visible = false;
            this.chart.Dock = DockStyle.Fill;
            this.chart.Location = new Point(0, 0x18);
            this.chart.Name = "chart";
            this.chart.OptionsPrint.SizeMode = PrintSizeMode.Zoom;
            this.chart.RuntimeSelection = true;
            this.chart.SeriesSerializable = new Series[0];
            label.LineVisible = true;
            this.chart.SeriesTemplate.Label = label;
            this.chart.Size = new Size(0x21d, 0x160);
            this.chart.TabIndex = 8;
            this.chart.Enter += new EventHandler(this.chart_Enter);
            this.chart.Leave += new EventHandler(this.chart_Leave);
            this.ppMenu.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiChart), new LinkPersistInfo(this.bbiGrid), new LinkPersistInfo(this.barSubItem1, true), new LinkPersistInfo(this.bbiPrint, true), new LinkPersistInfo(this.bbiRefresh) });
            this.ppMenu.Manager = this.barManager1;
            this.ppMenu.Name = "ppMenu";
            this.bbiChart.ButtonStyle = BarButtonStyle.Check;
            this.bbiChart.Caption = "Xem biểu đồ";
            this.bbiChart.Down = true;
            this.bbiChart.Id = 0;
            this.bbiChart.Name = "bbiChart";
            this.bbiChart.ItemClick += new ItemClickEventHandler(this.bbiChart_ItemClick);
            this.bbiGrid.ButtonStyle = BarButtonStyle.Check;
            this.bbiGrid.Caption = "Xem dữ liệu";
            this.bbiGrid.Id = 1;
            this.bbiGrid.Name = "bbiGrid";
            this.bbiGrid.ItemClick += new ItemClickEventHandler(this.bbiGrid_ItemClick);
            this.barSubItem1.Caption = "Dạng biểu đồ";
            this.barSubItem1.Id = 2;
            this.barSubItem1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiBar), new LinkPersistInfo(this.bbiPie), new LinkPersistInfo(this.bbiBar3D), new LinkPersistInfo(this.bbiPie3D) });
            this.barSubItem1.Name = "barSubItem1";
            this.bbiBar.Caption = "H\x00ecnh cột";
            this.bbiBar.Id = 3;
            this.bbiBar.Name = "bbiBar";
            this.bbiBar.ItemClick += new ItemClickEventHandler(this.ChartType_ItemClick);
            this.bbiPie.Caption = "H\x00ecnh tr\x00f2n";
            this.bbiPie.Id = 4;
            this.bbiPie.Name = "bbiPie";
            this.bbiPie.ItemClick += new ItemClickEventHandler(this.ChartType_ItemClick);
            this.bbiBar3D.Caption = "H\x00ecnh cột 3D";
            this.bbiBar3D.Id = 7;
            this.bbiBar3D.Name = "bbiBar3D";
            this.bbiBar3D.ItemClick += new ItemClickEventHandler(this.ChartType_ItemClick);
            this.bbiPie3D.Caption = "H\x00ecnh tr\x00f2n 3D";
            this.bbiPie3D.Id = 8;
            this.bbiPie3D.Name = "bbiPie3D";
            this.bbiPie3D.ItemClick += new ItemClickEventHandler(this.ChartType_ItemClick);
            this.bbiPrint.Caption = "In biểu đồ";
            this.bbiPrint.Id = 6;
            this.bbiPrint.Name = "bbiPrint";
            this.bbiPrint.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiRefresh.Caption = "Nạp lại";
            this.bbiRefresh.Id = 9;
            this.bbiRefresh.Name = "bbiRefresh";
            this.bbiRefresh.ItemClick += new ItemClickEventHandler(this.bbiRefresh_ItemClick);
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiChart, this.bbiGrid, this.barSubItem1, this.bbiBar, this.bbiPie, this.bbiExport, this.bbiPrint, this.bbiBar3D, this.bbiPie3D, this.bbiRefresh });
            this.barManager1.MaxItemId = 10;
            this.bbiExport.Caption = "Xuất dữ liệu";
            this.bbiExport.Id = 5;
            this.bbiExport.Name = "bbiExport";
            this.bbiExport.ItemClick += new ItemClickEventHandler(this.bbiExport_ItemClick);
            this.gcList.Dock = DockStyle.Fill;
            this.gcList.EmbeddedNavigator.Buttons.Append.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Remove.Visible = false;
            this.gcList.EmbeddedNavigator.TextStringFormat = "{0}/{1}";
            this.gcList.Location = new Point(0, 0);
            this.gcList.MainView = this.gbList;
            this.gcList.Name = "gcList";
            this.gcList.RepositoryItems.AddRange(new RepositoryItem[] { this.repAllowanceCode, this.repAllowanceName, this.repMoney });
            this.gcList.Size = new Size(0x21d, 0x178);
            this.gcList.TabIndex = 9;
            this.gcList.ViewCollection.AddRange(new BaseView[] { this.gbList });
            this.gbList.Appearance.GroupRow.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.gbList.Appearance.GroupRow.Options.UseFont = true;
            this.gbList.BorderStyle = BorderStyles.NoBorder;
            this.gbList.Columns.AddRange(new GridColumn[] { this.colName, this.colValue });
            this.gbList.GridControl = this.gcList;
            this.gbList.GroupPanelText = "K\x00e9o v\x00e0 Thả cột v\x00e0o đ\x00e2y để nh\x00f3m dữ liệu";
            this.gbList.IndicatorWidth = 40;
            this.gbList.Name = "gbList";
            this.gbList.OptionsBehavior.AllowIncrementalSearch = true;
            this.gbList.OptionsBehavior.AutoExpandAllGroups = true;
            this.gbList.OptionsBehavior.CopyToClipboardWithColumnHeaders = false;
            this.gbList.OptionsBehavior.FocusLeaveOnTab = true;
            this.gbList.OptionsLayout.StoreAllOptions = true;
            this.gbList.OptionsLayout.StoreAppearance = true;
            this.gbList.OptionsMenu.EnableColumnMenu = false;
            this.gbList.OptionsMenu.EnableGroupPanelMenu = false;
            this.gbList.OptionsNavigation.EnterMoveNextColumn = true;
            this.gbList.OptionsSelection.InvertSelection = true;
            this.gbList.OptionsSelection.MultiSelect = true;
            this.gbList.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
            this.gbList.OptionsView.EnableAppearanceEvenRow = true;
            this.gbList.OptionsView.RowAutoHeight = true;
            this.gbList.OptionsView.ShowColumnHeaders = false;
            this.gbList.OptionsView.ShowGroupPanel = false;
            this.gbList.OptionsView.ShowIndicator = false;
            this.gbList.OptionsView.ShowVertLines = false;
            this.colName.Caption = "Diễn giải";
            this.colName.Name = "colName";
            this.colName.OptionsColumn.ReadOnly = true;
            this.colName.Visible = true;
            this.colName.VisibleIndex = 0;
            this.colName.Width = 0xa8;
            this.colValue.Caption = "Gi\x00e1 trị";
            this.colValue.Name = "colValue";
            this.colValue.OptionsColumn.ReadOnly = true;
            this.colValue.Visible = true;
            this.colValue.VisibleIndex = 1;
            this.repAllowanceCode.AutoHeight = false;
            this.repAllowanceCode.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("repAllowanceCode.Buttons"), new KeyShortcut(Keys.None), appearance, "", null, null, true) });
            this.repAllowanceCode.DisplayFormat.FormatString = "{0:##,##0} VND";
            this.repAllowanceCode.EditFormat.FormatString = "{0:##,##0} VND";
            this.repAllowanceCode.Name = "repAllowanceCode";
            this.repAllowanceCode.NullText = "[Chọn m\x00e3 phụ cấp]";
            this.repAllowanceCode.View = this.repositoryItemGridLookUpEdit1View;
            this.repositoryItemGridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.gridColumn1, this.gridColumn2 });
            this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
            this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.gridColumn1.Caption = "M\x00e3 Phụ Cấp";
            this.gridColumn1.FieldName = "AllowanceCode";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn2.Caption = "T\x00ean Phụ Cấp";
            this.gridColumn2.FieldName = "AllowanceName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.repAllowanceName.AutoHeight = false;
            this.repAllowanceName.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("repAllowanceName.Buttons"), new KeyShortcut(Keys.None), obj3, "", null, null, true) });
            this.repAllowanceName.Name = "repAllowanceName";
            this.repAllowanceName.NullText = "[Chọn t\x00ean phụ cấp]";
            this.repAllowanceName.View = this.gridView1;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridColumn3, this.gridColumn4 });
            this.gridView1.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridColumn3.Caption = "M\x00e3 Phụ Cấp";
            this.gridColumn3.FieldName = "AllowanceCode";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 0;
            this.gridColumn4.Caption = "T\x00ean Phụ Cấp";
            this.gridColumn4.FieldName = "AllowanceName";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 1;
            this.repMoney.AutoHeight = false;
            this.repMoney.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repMoney.Mask.UseMaskAsDisplayFormat = true;
            this.repMoney.Name = "repMoney";
            this.ppMenu1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiChart), new LinkPersistInfo(this.bbiGrid), new LinkPersistInfo(this.bbiExport, true), new LinkPersistInfo(this.bbiRefresh) });
            this.ppMenu1.Manager = this.barManager1;
            this.ppMenu1.Name = "ppMenu1";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.chart);
            base.Controls.Add(this.panelControl8);
            base.Controls.Add(this.gcList);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xucChartBase";
            base.Size = new Size(0x21d, 0x178);
            this.panelControl8.EndInit();
            this.panelControl8.ResumeLayout(false);
            this.panelControl8.PerformLayout();
            ((ISupportInitialize) label).EndInit();
            this.chart.EndInit();
            this.ppMenu.EndInit();
            this.barManager1.EndInit();
            this.gcList.EndInit();
            this.gbList.EndInit();
            this.repAllowanceCode.EndInit();
            this.repositoryItemGridLookUpEdit1View.EndInit();
            this.repAllowanceName.EndInit();
            this.gridView1.EndInit();
            this.repMoney.EndInit();
            this.ppMenu1.EndInit();
            base.ResumeLayout(false);
        }

        private void lbExport_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            base._exportView = this.gbList;
            SYS_LOG.Insert("Biểu đồ", "Xuất");
            base.Export();
        }

        public void LoadChart(int Type, DataTable DataChart)
        {
            Series series;
            SeriesPoint point;
            this.m_DataChart = DataChart;
            this.m_Type = Type;
            this.chart.Series.Clear();
            if (this.m_Type == 0)
            {
                foreach (DataRow row in this.m_DataChart.Rows)
                {
                    series = new Series(row[0].ToString(), ViewType.Bar);
                    point = new SeriesPoint(row[0].ToString(), new double[] { double.Parse(row[1].ToString()) });
                    series.Points.Add(point);
                    this.chart.Series.Add(series);
                }
                this.chart.RuntimeSeriesSelectionMode = SeriesSelectionMode.Series;
            }
            else if (this.m_Type == 1)
            {
                series = new Series(" ", ViewType.Pie) {
                    PointOptions = { PointView = PointView.ArgumentAndValues }
                };
                foreach (DataRow row in this.m_DataChart.Rows)
                {
                    point = new SeriesPoint(row[0].ToString(), new double[] { double.Parse(row[1].ToString()) });
                    series.Points.Add(point);
                }
                this.chart.Series.Add(series);
                series.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
                series.PointOptions.ValueNumericOptions.Precision = 0;
                this.chart.RuntimeSeriesSelectionMode = SeriesSelectionMode.Point;
            }
            else if (this.m_Type == 2)
            {
                foreach (DataRow row in this.m_DataChart.Rows)
                {
                    series = new Series(row[0].ToString(), ViewType.Bar3D);
                    point = new SeriesPoint(row[0].ToString(), new double[] { double.Parse(row[1].ToString()) });
                    series.Points.Add(point);
                    this.chart.Series.Add(series);
                }
                this.chart.RuntimeSeriesSelectionMode = SeriesSelectionMode.Series;
                (this.chart.Diagram as Diagram3D).RuntimeRotation = true;
                (this.chart.Diagram as Diagram3D).RuntimeScrolling = true;
                (this.chart.Diagram as Diagram3D).RuntimeZooming = true;
            }
            else if (this.m_Type == 3)
            {
                series = new Series(" ", ViewType.Pie3D) {
                    PointOptions = { PointView = PointView.ArgumentAndValues }
                };
                foreach (DataRow row in this.m_DataChart.Rows)
                {
                    point = new SeriesPoint(row[0].ToString(), new double[] { double.Parse(row[1].ToString()) });
                    series.Points.Add(point);
                }
                this.chart.Series.Add(series);
                series.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
                series.PointOptions.ValueNumericOptions.Precision = 0;
                this.chart.RuntimeSeriesSelectionMode = SeriesSelectionMode.Point;
                (this.chart.Diagram as Diagram3D).RuntimeRotation = true;
                (this.chart.Diagram as Diagram3D).RuntimeScrolling = true;
                (this.chart.Diagram as Diagram3D).RuntimeZooming = true;
            }
            this.colName.FieldName = this.m_DataChart.Columns[0].ColumnName;
            this.colValue.FieldName = this.m_DataChart.Columns[1].ColumnName;
            this.gcList.DataSource = this.m_DataChart;
        }

        public virtual void PrintChart()
        {
            xfmReport report = new xfmReport("Biểu Đồ");
            rptChartBase xtraReport = new rptChartBase(this.m_Type, this.m_DataChart, this.m_NameChart);
            report.ShowPrintPreview(xtraReport);
        }

        protected virtual void ReloadData()
        {
        }
    }
}

